Many devices include loudspeakers, which are used to play sounds to a user of the device, based on an input signal. For example, the input signal may be derived from a signal that has been received by the device over a communications link, in the case of a phone call or the like, or may be derived from stored data, in the case of music or speech playback.
As wireless communication devices, Mp3 players and other devices for audio playback move even further into everyday use, features like noise cancellation become more important to help ensure higher-quality audio playback and phone calls.
Noise cancellation embraces a number of different approaches to eliminating unwanted noise in order to enhance the listening experience of a user. Active noise cancellation (ANC) or noise control refers to a method of reducing noise by the addition of anti-noise—i.e. a phase inverted noise signal—which destructively interferes with the noise. This is generally achieved by using a reference microphone to sense environmental or ambient noise and by deriving an anti-noise signal that is emitted by a speaker in order to cancel or at least control the noise. As will be appreciated by those skilled in the art active noise control can be achieved with analogue filters or digital filters, and is generally differentiated by architecture: feed-forward cancellation, feedback cancellation or hybrid cancellation.
FIG. 1 provides a simplified illustration of a feedforward ANC system. As illustrated in FIG. 1, a reference microphone 10 detects incident ambient sounds—or noise—and generates an input signal x(n) for an ANC circuit 20. The ANC circuit 20 processes the signal in order to derive a control signal y(n) which is passed to the loudspeaker transducer 30 and is emitted by the loudspeaker 30 as anti-noise. Thus, the ANC circuit may be considered to comprise a filter having a transfer function Hnc which inversely models the noise signal for generating the required control sound signal. An error microphone (not shown) is typically provided to measure the error between the noise signal and the anti-noise signal in order that the transfer function Hnc or the respective gain of the ANC circuit may be adapted.
As illustrated in FIG. 2, it will be appreciated that the anti-noise signal will not only propagate on a path towards a user's ear Hde (where d denotes the driver and e denotes the ear), but may also propagate on a leakage path, or feedback path Hdm (where d denotes the driver/loudspeaker and m denotes the microphone), towards the reference microphone. This is known as acoustic feedback and results in a corrupted reference signal u(n). Thus, the reference signal will additionally contain the acoustic feedback signal that is sensed by the reference microphone. When an acoustic control system has a feedback path the leakage often causes unstable behaviour called howling which results in an audible feedback tone.
It will therefore be appreciated that the stability of a noise control system will be significantly influenced by the feedback signal and will depend on the transfer characteristics of an acoustic feedback path Hdm between the speaker and the reference microphone. A similar problem can arise when the speech captured by the voice microphone leaks to the speaker (driver). The problem of acoustic feedback is particularly an issue in the case of a mobile communication device, such as a mobile phone, due to the close proximity between the reference microphone and the speaker.
The frequency of the feedback tone depends on Hdm in conjunction with Hnc. Since both Hdm and Hnc can change, the tone frequency can change respectively across a wide range of frequencies. The level of the feedback tone may rise quickly as the energy of the reference signal rises exponentially. Thus, the feedback tone is unpleasant and potentially damaging to the ear. There is therefore a need to try to manage and/or suppress the occurrence of howling.
A number of techniques have been proposed that seek to detect the occurrence of howling in order to enable the gain of the circuit to be automatically adjusted. However, the previously considered techniques suffer from a number of disadvantages, including high latency, the need for relatively complex frequency domain processing and problems associated with the occurrence of false positive detection of howling. For example, a previously proposed method involves a maximum peak detection method which involves performing a linear search for a sustained peak in the energy of the signal across multiple consecutive frames. As a consequence of the need to locate and track several frames of the signal, the system introduces a latency between the initial occurrence of howling and the detection of howling. Consequently, any subsequent measures taken to mitigate the feedback tone take place after a certain delay, and potentially after the sound has risen to an audible level.
The present examples are concerned with techniques for detecting howling, in particular to howling detection techniques which alleviate one or more of the problems associated with previously proposed howling detection methods.
According to an example of a first aspect there is provided a processing module for a noise control circuit, the processing module comprising:                a howling detector configured to receive an input signal and to determine a linearity metric based on the input signal, the linearity metric comprising a measure of the linearity of a logarithmic representation of the energy of the input signal; and        a gain adjuster configured to adjust the gain of a noise control unit.        
The linearity metric—or log-linearity metric—may be derived by computing a difference between the logarithm of the energy of the signal and a trend line, the trend line being is a straight line representation of the logarithm of the energy of the signal. Coefficients of the trend line may be derived by a fitting a line to the logarithmic representation of the energy of the input signal. The process of fitting a line to the logarithmic representation of the energy of the input signal may comprise performing a least squares computation which minimises a difference between the trend line and the logarithmic representation of the energy of the input signal.
According to one or more examples the linearity metric is determined according to a goodness of fit measure of the computed trend line to the logarithm of the energy of the input signal over P samples. The goodness of fit measure r(n) may be represented by:
      r    ⁡          (      n      )        =                    ∑                  i          =          0                          P          -          1                    ⁢                        (                                    y              ⁡                              (                                  n                  -                  i                                )                                      -                          (                                                                                          β                      ^                                        0                                    ⁡                                      (                    n                    )                                                  +                                                      (                                          P                      -                      i                                        )                                    ·                                                                                    β                        ^                                            1                                        ⁡                                          (                      n                      )                                                                                  )                                )                2            where y(n) is the log energy of the input signal, {circumflex over (β)}0(n) is the bias of the trend line and {circumflex over (β)}1(n) is the slope of the trend line.
According to one or more examples the howling detection unit may be further configured to issue a command to the gain adjuster in order to reduce the gain if the linearity metric exceeds a predetermined threshold. The gain adjuster may be configured to adjust the gain by a fixed amount or by an amount which is proportional to the slope of the trend line.
According to one or more examples the howling detection unit may be further configured to estimate a maximum stable gain of the noise control unit. The maximum stable gain is proportional to the slope of the trend line.
The howling detection unit may be configured to determine, based on the determined linearity metric, if howling is likely or imminent.
According to a further aspect there is provided an audio processing system comprising a processing module according to the first aspect. The audio processing system may further comprise a noise control unit for generating a noise control signal based on a reference input signal which represents a sound detected by a reference microphone. The processing module may be connected to a speaker and wherein the speaker generates an anti-noise signal based on the noise control signal in order to cancel or at least reduce the noise detected by a reference microphone.
According to one example the howling detector may be provided in parallel with the noise control unit.
According to one example the audio processing system may further comprise a filter configured to filter out one or more frequencies or frequency bands of the input signal. The audio processing system may comprise a filterbank configured to split the input signal into a plurality of frequency bands, wherein the howling detector is operable to determine a linearity metric for each frequency band.
According to at least one example of a third aspect, there is provided a processing circuit for a noise control module comprising: a gain adjustment mechanism configured to adjust the gain of a noise control circuit if a plot of the energy of an input signal in the log domain becomes linear or tends towards linearity.
The gain of the noise control circuit may be adjusted by an amount that related to an amount which is proportional to the slope of the trend line.
The processing module may be provided in the form of a monolithic integrated circuit.
According to an example of a further aspect there is provided a device comprising a processing module according to the first aspect or a processing circuit according to the third aspect, wherein the device comprises a mobile telephone, headphone, acoustic noise cancelling headphones, a smart watch, an audio player, a video player, a mobile computing platform, a games device, a remote controller device, a toy, a machine, or a home automation controller, a domestic appliance or other portable device.
According to a fourth aspect there is provided a method of processing an audio signal comprising:                determining a linearity metric based on an input signal, the linearity metric comprising a measure of the linearity of a logarithmic representation of the energy of the input signal; and        adjusting the gain of the noise control unit if the linearity metric exceeds a predetermined threshold.        
The step of determining a linearity metric may comprise computing a difference between the logarithm of the energy of the signal and a trend line, the trend line being is a straight line representation of the logarithm of the energy of the signal.